Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

387
Views
geodjango with mysql getting error django.db.utils.OperationalError: (1045, "Access denied for user

seetings.py

DATABASES = {
'default': {
    'ENGINE':'django.db.backends.mysql','django.contrib.gis.db.backends.mysql'
    'OPTIONS': {
        'read_default_file': os.path.join(PROJECT_ROOT,"my.cnf"),
    },
 },

}

without 'django.contrib.gis.db.backends.mysql' the code is working fine but since i want to use django geolocation using mysql, i added this (if I don't add I get

'databaseoperations' object has no attribute 'geo_db_type'

error), and now I am getting

django.db.utils.OperationalError: (1045, "Access denied for user ---" error although the user has full privileges.

Please help I am new to django

Thank you

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

It seems like you try to set multiple database backends in your settings but you need just one: django.contrib.gis.db.backends.mysql works for both spatial and non-spatial use cases.

So your settings.py should probably look something like this:

DATABASES = {
    'default': {
        'ENGINE': 'django.contrib.gis.db.backends.mysql',
        'OPTIONS': {
            'read_default_file': os.path.join(PROJECT_ROOT,"my.cnf"),
        },
    },
}
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!